﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _55读取文件
{
    class Program
    {
        static void Main(string[] args)
        {
            //byte[]buffer = File.ReadAllBytes(@"C:\Users\Administrator\Desktop\学习笔记\1.txt");

            //string str = System.Text.Encoding.Default.GetString(buffer);
            //Console.WriteLine(str);
            //Console.ReadKey();


            //Encoding.Default  防止乱码
            string str =  File.ReadAllText("1.txt",Encoding.Default);
            //关闭流
            //fsRead.Close();
            //释放流所占用的空间
            //fsRead.Dispose();
            Console.WriteLine(str);
            Console.ReadKey();
        }
    }
}
